import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { SqlOTmService } from './sql-o-tm.service';
import { CreateSqlOTmDto } from './dto/create-sql-o-tm.dto';
import { UpdateSqlOTmDto } from './dto/update-sql-o-tm.dto';

@Controller('sql-otm')
export class SqlOTmController {
  constructor(private readonly sqlOTmService: SqlOTmService) { }

  @Post('create')
  create(@Body() createSqlOTmDto: CreateSqlOTmDto) {
    return this.sqlOTmService.create(createSqlOTmDto);
  }

  @Post('update')
  updateData(@Body() createSqlOTmDto: CreateSqlOTmDto) {
    return this.sqlOTmService.updateData(createSqlOTmDto);
  }


  @Get()
  findAll() {
    return this.sqlOTmService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.sqlOTmService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateSqlOTmDto: UpdateSqlOTmDto) {
    return this.sqlOTmService.update(+id, updateSqlOTmDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.sqlOTmService.remove(+id);
  }
}
